package com.srpngfox.demo.controller;

import com.srpngfox.demo.domain.Teacher;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TeacherController {


    @PostMapping(value = "/getTeacher", consumes = MediaType.APPLICATION_XML_VALUE, produces = MediaType.APPLICATION_XML_VALUE)
    @ResponseBody
    public Teacher getTeacher(@RequestBody Teacher teacher) {
        teacher.setName("didispace.com : " + teacher.getName());
        teacher.setAge(teacher.getAge() + 100);
        return teacher;
    }
}
